package org.example.hypersonaltools.scene;

import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import org.example.hypersonaltools.manager.SceneManager;


public class PrimaryScene implements FXScene {

    private BorderPane root;
    private StackPane contentArea;
    private Scene scene;

    public PrimaryScene() {
        SceneManager sceneManager = SceneManager.getInstance();
        // 创建根布局，使用BorderPane来分割布局
        root = new BorderPane();

        // 创建标题并添加到顶部
        Label titleLabel = new Label("应用标题");
        root.setTop(titleLabel);

        // 创建导航栏（左侧）
        VBox navPane = new VBox();
        Button navBtn1 = new Button("工具集");

        navBtn1.setOnAction(e -> sceneManager.switchChildScene("primaryScene","testosterone"));

        Button navBtn2 = new Button("Scene 2");
        navBtn2.setOnAction(e -> sceneManager.switchChildScene("primaryScene","scene2"));

        navPane.getChildren().addAll(navBtn1, navBtn2);

        root.setLeft(navPane);

        // 创建内容区域
        contentArea = new StackPane();
        root.setCenter(contentArea);

        scene = new Scene(root, 800, 600);

    }

    @Override
    public Scene getScene() {
        return scene;
    }

    @Override
    public void onEnter() {
        System.out.println("Entering Scene 1");
    }

    @Override
    public void onExit() {
        System.out.println("Exiting Scene 1");
    }

    public BorderPane getRoot() {
        return root;
    }
}
